import request from '@/utils/request'
import type { loginForm, loginResponseData, userResponseData } from './type'
// import type {
//   LoginFormData,
//   LoginResponseData,
//   UserInfoResponseData,
// } from './type'
enum API {
  LOGIN_URL = '/user/login',
  USERINFO_URL = '/user/info',
}

export const reqLogin = (data: loginForm) =>
  request.post<any, loginResponseData>(API.LOGIN_URL, data)

export const reqUserInfo = () =>
  request.get<any, userResponseData>(API.USERINFO_URL)

// enum API {
//   LOGIN_URL = '/admin/acl/index/login',
//   USERINFO_URL = '/admin/acl/index/info',
//   LOGOUT_URL = '/admin/acl/index/logout',
// }

// // 登录接口
// export const reqLogin = (data: LoginFormData) =>
//   request.post<any, LoginResponseData>(API.LOGIN_URL, data)

// // 获取用户信息接口
// export const reqUserInfo = () =>
//   request.get<any, UserInfoResponseData>(API.USERINFO_URL)

// // 登出接口
// export const reqLogout = () => request.post<any, any>(API.LOGOUT_URL)
